USE [xRepair]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[GetUserInfoByUserName]
	@UserName		NVARCHAR(150),
	@Password		NVARCHAR(200)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	SELECT 
		 [ID]
		,[RoleID]
		,[Username]
		,[Password]
		,[Salt]
		,[Alias]
		,[EmailAddress]
	FROM [xRepair].[dbo].[Users] WITH(NOLOCK)
	WHERE 
		([IsActive] = 1 OR [IsActive] IS NULL)
		AND [Username] = @UserName
		AND [Password] = @Password
		AND [ActivationCode] IS NULL

END
